/*
 * cStateManager.h
 *
 *  Created on: 11.2.2009
 *      Author: jari.ravantti
 *
 *      This is the base object header for StateManager
 */

#ifndef CSTATEMANAGER_H_
#define CSTATEMANAGER_H_
#include <vector> //vector needed for state stack

#include "../../graphics/basecode/CWindow.h" 	//include object for initializing sdl/opengl window

#include "../../defines/defines.h"			 	// program defines.

#ifdef DEBUG
#include "../../logger/CLogger.h"
#endif


class CStateBase;

class CStateManager {
public:
	void Init();
	void Cleanup();

	void HandleEvents();

	void Pause();
	void Resume();

	void Update();
	void Draw();

	void ChangeState(CStateBase* state);	//function to clear and change state
	void PushState(CStateBase* state);		//function for pushing state to stack
	void PopState();						//function to pop state from stack

	bool Running() {						//function to return if engine is runnig
		return m_running;
	}

	void Quit() {							//function to quit engine
		m_running = false;
	}

private:
	std::vector<CStateBase*> states;		//state stack vector
	bool m_running;

	CWindow m_Window;
};

#endif /* CStateManager_H_ */
